<!-- 
    script里面
    1. 记得添加上 setup 属性
    2. 一定要加上 lang='ts'
 -->
<script setup lang='ts'>
import { ref } from 'vue';
import Son from './components/Son.vue';
const money = ref(10000)
const car = ref('大货车')

const add = (val: number) => {
    money.value += val
}

const changeCar = () => {
    car.value = '宝马'
}
</script>

<template>
    <div>我是父组件 - {{money}}</div>
    <Son :money="money" :car="car" @add="add" @changeCar="changeCar"></Son>
</template>